<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"   
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"  
     xmlns:p="http://primefaces.org/ui" >
    
    <h:form id="formEdit" prependId="false">
		<p:dialog header="#{msg['form.proveedor.edit.titulo']}" widgetVar="proveedorEditDialog" resizable="false" id="proveedorEditDlg" modal="true">
	        <h:panelGrid id="displayEdit" columns="3" cellpadding="4" style="margin:0 auto;">  
	            <h:outputText for="codigoEdit" value="#{msg['form.proveedor.edit.codigo']}: " style="font-weight:bold"/>
	            <h:outputText id="codigoEdit" value="#{proveedorBean.proveedorSelected.codigo}" />
	  			<p:message for="codigoEdit"/>
	  			
	            <h:outputText for="nitEdit" value="#{msg['form.proveedor.edit.nit']}: " style="font-weight:bold"/>
	            <p:inputText id="nitEdit" value="#{proveedorBean.proveedorSelected.nit}" required="true" label="#{msg['form.proveedor.edit.nit']}">
					<f:validateLength minimum="7" maximum="12"/>
				</p:inputText>
	            <p:message for="nitEdit"/>
	  
	            <h:outputText for="nombreEdit" value="#{msg['form.proveedor.edit.nombre']}: " style="font-weight:bold"/>
	            <p:inputText id="nombreEdit" value="#{proveedorBean.proveedorSelected.nombre}" required="true" label="#{msg['form.proveedor.edit.nombre']}">
					<f:validateLength maximum="50"/>
				</p:inputText>
	            <p:message for="nombreEdit"/>
	  
	            <h:outputText for="telefonoEdit" value="#{msg['form.proveedor.edit.telefono']}: " style="font-weight:bold"/>
	            <p:inputText id="telefonoEdit" value="#{proveedorBean.proveedorSelected.telefono}" required="true" label="#{msg['form.proveedor.edit.telefono']}">
					<f:validateLength maximum="50"/>
				</p:inputText>
	            <p:message for="telefonoEdit"/>
	            
	            <h:outputText for="faxEdit" value="#{msg['form.proveedor.edit.fax']}: " style="font-weight:bold"/>
	            <p:inputText id="faxEdit" value="#{proveedorBean.proveedorSelected.fax}" required="true" label="#{msg['form.proveedor.edit.fax']}">
					<f:validateLength maximum="50"/>
				</p:inputText>
	            <p:message for="faxEdit"/>
	            
	            <h:outputText for="direccionEdit" value="#{msg['form.proveedor.edit.direccion']}: " style="font-weight:bold"/>
	            <p:inputText id="direccionEdit" value="#{proveedorBean.proveedorSelected.direccion}" required="true" label="#{msg['form.proveedor.edit.direccion']}">
					<f:validateLength maximum="50"/>
				</p:inputText>
	            <p:message for="direccionEdit"/>
	            
	            <h:panelGroup style="text-align: center;">
	            	<p:commandButton id="btGuardarEdit" value="#{msg['form.proveedor.boton.guardar']}" actionListener="#{proveedorBean.actualizarProveedor}" update=":formListProveedor:proveedoresTable,:formEdit" onsuccess="proveedorEditDialog.hide()" process="@form"/>
	            </h:panelGroup>
	        </h:panelGrid>
		</p:dialog>
	</h:form>
</ui:composition>